def func(n):
  return n %2==0  # True or False

list1=[1,2,3,4,5,6,7,8]

result=filter(func,list1)
print(list(result))
